package easy;

public class a1323_6和9组成的最大数字 {
    public int maximum69Number (int num) {
        StringBuilder stringBuilder=new StringBuilder(Integer.toString(num));
        for(int i=0;i<stringBuilder.length();i++){
            if(stringBuilder.charAt(i)=='6'){
                stringBuilder.deleteCharAt(i);
                stringBuilder.insert(i,9);
                break;
            }
        }
        return Integer.parseInt(stringBuilder.toString());
    }
}
